package net.xmat.webtest.dao.impl;

import java.util.List;

import org.hibernate.Session;

import net.xmat.webtest.beans.Book;
import net.xmat.webtest.dao.IBookDao;
import net.xmat.webtest.utils.HibernateOperations;

public class BookDao implements IBookDao {

	public List<Book> list(String name) {
		return HibernateOperations.list(Book.class, name);
	}

	public void save(final Book book) {
		new HibernateTransaction().execute( new IHibernateWork() {
			public void doInTransaction(Session session) {
				session.saveOrUpdate(book);
			}
		});
	}

	public Book get(Long id) {
		return null;
	}
}
